#include "gui/objects/GUIRoute.h"

namespace gui {

GUIRoute::GUIRoute(RouteController* routeController) {
	if (routeController != NULL) {
		// Se agregan los GUIRouteIntersection.
		util::LinkedList<MapPoint>::Iterator it = routeController->getRemainingIntersections();
		while (it.hasNext()) {
			this->guiObjects.append(this->factory->createGUIRouteIntersection(it.next()));
		}
		// Se agregan los GUIRouteSegment y GUIRouteArrow.
		it = routeController->getRemainingIntersections();
		if (it.hasNext()) {
			MapPoint* previous = it.next();
			while (it.hasNext()) {
				MapPoint* current = it.next();
				this->guiObjects.append(this->factory->createGUIRouteSegment(previous, current, 0));
				this->guiObjects.append(this->factory->createGUIRouteArrow(previous, current, 15));
				previous = current;
			}
		}
	}
}

GUIRoute::~GUIRoute() {

}

}
